/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.IOException;
import java.util.Date;
import java.util.Vector;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 * @author Administrator
 */
public class MLet extends MIDlet implements CommandListener {

    private boolean midletPaused = false;
    private CliDB cli = null;
    public Date base_date = null;
    public String plan_list_title = "Планы";
    public Vector items = null;
    public UniItem item = null;

    public String actor_id = "0";

    //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private java.util.Hashtable __previousDisplayables = new java.util.Hashtable();
    private Form formLogin;
    private TextField txtPassword;
    private TextField txtEmail;
    private CanvasWait waitLogin;
    private Form formPlanParams;
    private DateField dateOf;
    private StringItem cityOf;
    private TextField strPlanSearch;
    private List listRootMenu;
    private CanvasWait waitCountries;
    private Alert alert;
    private CanvasWait waitPlanSearch;
    private List listPlans;
    private Form formPlan;
    private ImageItem imgPlanTime;
    private StringItem strPlanText;
    private List listCountries;
    private List listRegions;
    private CanvasWait waitRegions;
    private CanvasWait waitCities;
    private List listCities;
    private List listUsers;
    private List listLinks;
    private Form formUserParams;
    private TextField strUserSearch;
    private CanvasWait waitUserSearch;
    private List listPlanCategs;
    private CanvasWait waitPlanSelect;
    private CanvasWait waitUsers;
    private Form formUser;
    private StringItem strUserShort;
    private Command cmdLogin;
    private Command cmdCancel;
    private Command cmdOk;
    private Command cmdBack;
    private Command cmdSelectCity;
    private Command cmdShare;
    private Command cmdAnyCity;
    private Command cmdWatch;
    private Command cmdPlan;
    private Command cmdInCity;
    private Command itemCommand;
    private Command cmdUserPlans;
    private Command cmdMore;
    private Command cmdLogin1;
    private Command cmdGoLogin;
    private Command cmdResetCity;
    private Command cmdFindInCity;
    private Command cmdFindAnywhere;
    private Command cmdWM;
    private Command cmdWS;
    private Command cmdFM;
    private Command cmdFS;
    private Command cmdMenuLinks;
    private Command cmdDoWatch;
    //</editor-fold>//GEN-END:|fields|0|

    /**
     * The MLet constructor.
     */
    public MLet() {
    }

    //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
    /**
     * Switches a display to previous displayable of the current displayable.
     * The <code>display</code> instance is obtain from the <code>getDisplay</code> method.
     */
    private void switchToPreviousDisplayable() {
        Displayable __currentDisplayable = getDisplay().getCurrent();
        if (__currentDisplayable != null) {
            Displayable __nextDisplayable = (Displayable) __previousDisplayables.get(__currentDisplayable);
            if (__nextDisplayable != null) {
                switchDisplayable(null, __nextDisplayable);
            }
        }
    }
    //</editor-fold>//GEN-END:|methods|0|
    //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initilizes the application.
     * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
        cli = CliDB.getInstance();
        items = new Vector();
        test();
//GEN-LINE:|0-initialize|1|0-postInitialize
        // write post-initialize user code here
    }//GEN-BEGIN:|0-initialize|2|
    //</editor-fold>//GEN-END:|0-initialize|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
        testPassword();//GEN-LINE:|3-startMIDlet|1|3-postAction
        // write post-action user code here
    }//GEN-BEGIN:|3-startMIDlet|2|
    //</editor-fold>//GEN-END:|3-startMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
    //</editor-fold>//GEN-END:|4-resumeMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        Displayable __currentDisplayable = display.getCurrent();
        if (__currentDisplayable != null  &&  nextDisplayable != null) {
            __previousDisplayables.put(nextDisplayable, __currentDisplayable);
        }
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
        // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
    //</editor-fold>//GEN-END:|5-switchDisplayable|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: testPassword ">//GEN-BEGIN:|14-if|0|14-preIf
    /**
     * Performs an action assigned to the testPassword if-point.
     */
    public void testPassword() {//GEN-END:|14-if|0|14-preIf
        // enter pre-if user code here
        System.out.println("testPassword() -> password: "+ cli.getPassword());
        if (cli.getPassword() != null) {//GEN-LINE:|14-if|1|15-preAction
            // write pre-action user code here
            System.out.println("password is not null");
//            HostDB host = new HostDB(this);
//            host.login(cli.getEMail(), cli.getPassword());
            switchDisplayable(null, getListRootMenu());//GEN-LINE:|14-if|2|15-postAction
            // write post-action user code here
        } else {//GEN-LINE:|14-if|3|16-preAction
            // write pre-action user code here
            System.out.println("password is null");
            switchDisplayable(null, getFormLogin());//GEN-LINE:|14-if|4|16-postAction
            // write post-action user code here
        }//GEN-LINE:|14-if|5|14-postIf
        // enter post-if user code here
    }//GEN-BEGIN:|14-if|6|
    //</editor-fold>//GEN-END:|14-if|6|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular displayable.
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == formLogin) {//GEN-BEGIN:|7-commandAction|1|21-preAction
            if (command == cmdLogin) {//GEN-END:|7-commandAction|1|21-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.login(txtEmail.getString(), txtPassword.getString());
                switchDisplayable(null, getWaitLogin());//GEN-LINE:|7-commandAction|2|21-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|3|94-preAction
        } else if (displayable == formPlan) {
            if (command == cmdBack) {//GEN-END:|7-commandAction|3|94-preAction
                // write pre-action user code here
                switchDisplayable(null, getListPlans());//GEN-LINE:|7-commandAction|4|94-postAction
                // write post-action user code here
            } else if (command == cmdInCity) {//GEN-LINE:|7-commandAction|5|140-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryEvents(null, item.getStr("city_id"), null, null);
                setPlansTitle("г.", item.getStr("city"));
                switchDisplayable(null, getWaitPlanSearch());//GEN-LINE:|7-commandAction|6|140-postAction
                // write post-action user code here
            } else if (command == cmdUserPlans) {//GEN-LINE:|7-commandAction|7|141-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryEvents(item.getStr("user_id"), null, null, null);
                setPlansTitle(item.getStr("user"), null);
                switchDisplayable(null, getWaitPlanSearch());//GEN-LINE:|7-commandAction|8|141-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|9|50-preAction
        } else if (displayable == formPlanParams) {
            if (command == cmdBack) {//GEN-END:|7-commandAction|9|50-preAction
                // write pre-action user code here
                switchDisplayable(null, getListRootMenu());//GEN-LINE:|7-commandAction|10|50-postAction
                // write post-action user code here
            } else if (command == cmdFindAnywhere) {//GEN-LINE:|7-commandAction|11|209-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.findEvents(strPlanSearch.getString(), dateOf.getDate(), null);
                setPlansTitle("Поиск везде", null);
                switchDisplayable(null, getWaitPlanSearch());//GEN-LINE:|7-commandAction|12|209-postAction
                // write post-action user code here
            } else if (command == cmdFindInCity) {//GEN-LINE:|7-commandAction|13|207-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.findEvents(strPlanSearch.getString(), dateOf.getDate(), cli.getCityID());
                setPlansTitle("Поиск в г.", cli.getCity());
                switchDisplayable(null, getWaitPlanSearch());//GEN-LINE:|7-commandAction|14|207-postAction
                // write post-action user code here
            } else if (command == cmdSelectCity) {//GEN-LINE:|7-commandAction|15|60-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryCountries();
                switchDisplayable(null, getWaitCountries());//GEN-LINE:|7-commandAction|16|60-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|17|230-preAction
        } else if (displayable == formUser) {
            if (command == cmdBack) {//GEN-END:|7-commandAction|17|230-preAction
                // write pre-action user code here
                switchDisplayable(null, getListUsers());//GEN-LINE:|7-commandAction|18|230-postAction
                // write post-action user code here
            } else if (command == cmdFM) {//GEN-LINE:|7-commandAction|19|242-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryUsers("FM", item.getStr("id"));
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|20|242-postAction
                // write post-action user code here
            } else if (command == cmdFS) {//GEN-LINE:|7-commandAction|21|243-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryUsers("FS", item.getStr("id"));
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|22|243-postAction
                // write post-action user code here
            } else if (command == cmdUserPlans) {//GEN-LINE:|7-commandAction|23|250-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryEvents(item.getStr("id"), null, null, null);
                setPlansTitle(item.getStr("user"), null);
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|24|250-postAction
                // write post-action user code here
            } else if (command == cmdWM) {//GEN-LINE:|7-commandAction|25|239-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryUsers("WM", item.getStr("id"));
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|26|239-postAction
                // write post-action user code here
            } else if (command == cmdWS) {//GEN-LINE:|7-commandAction|27|241-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryUsers("WS", item.getStr("id"));
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|28|241-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|29|147-preAction
        } else if (displayable == formUserParams) {
            if (command == cmdBack) {//GEN-END:|7-commandAction|29|147-preAction
                // write pre-action user code here
                switchDisplayable(null, getListRootMenu());//GEN-LINE:|7-commandAction|30|147-postAction
                // write post-action user code here
            } else if (command == cmdOk) {//GEN-LINE:|7-commandAction|31|149-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.findUsers(strUserSearch.getString());
                switchDisplayable(null, getWaitUserSearch());//GEN-LINE:|7-commandAction|32|149-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|33|122-preAction
        } else if (displayable == listCities) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|33|122-preAction
                // write pre-action user code here
                listCitiesAction();//GEN-LINE:|7-commandAction|34|122-postAction
                // write post-action user code here
            } else if (command == cmdBack) {//GEN-LINE:|7-commandAction|35|126-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormPlanParams());//GEN-LINE:|7-commandAction|36|126-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|37|100-preAction
        } else if (displayable == listCountries) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|37|100-preAction
                // write pre-action user code here
                listCountriesAction();//GEN-LINE:|7-commandAction|38|100-postAction
                // write post-action user code here
            } else if (command == cmdBack) {//GEN-LINE:|7-commandAction|39|102-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormPlanParams());//GEN-LINE:|7-commandAction|40|102-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|41|160-preAction
        } else if (displayable == listLinks) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|41|160-preAction
                // write pre-action user code here
                listLinksAction();//GEN-LINE:|7-commandAction|42|160-postAction
                // write post-action user code here
            } else if (command == cmdBack) {//GEN-LINE:|7-commandAction|43|169-preAction
                // write pre-action user code here
                switchDisplayable(null, getListRootMenu());//GEN-LINE:|7-commandAction|44|169-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|45|184-preAction
        } else if (displayable == listPlanCategs) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|45|184-preAction
                // write pre-action user code here
                listPlanCategsAction();//GEN-LINE:|7-commandAction|46|184-postAction
                // write post-action user code here
            } else if (command == cmdBack) {//GEN-LINE:|7-commandAction|47|190-preAction
                // write pre-action user code here
                switchDisplayable(null, getListRootMenu());//GEN-LINE:|7-commandAction|48|190-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|49|87-preAction
        } else if (displayable == listPlans) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|49|87-preAction
                // write pre-action user code here
                System.out.println("listPlans -> List.SELECT_COMMAND");
                listPlansAction();//GEN-LINE:|7-commandAction|50|87-postAction
                // write post-action user code here
            } else if (command == cmdBack) {//GEN-LINE:|7-commandAction|51|92-preAction
                // write pre-action user code here
                switchDisplayable(null, getListPlanCategs());//GEN-LINE:|7-commandAction|52|92-postAction
                // write post-action user code here
            } else if (command == cmdInCity) {//GEN-LINE:|7-commandAction|53|131-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                int i = listPlans.getSelectedIndex();
                item = (UniItem)items.elementAt(i);
                host.queryEvents(null, item.getStr("city_id"), null, null);
                setPlansTitle("г.", item.getStr("city"));
                switchDisplayable(null, getWaitPlanSearch());//GEN-LINE:|7-commandAction|54|131-postAction
                // write post-action user code here
            } else if (command == cmdUserPlans) {//GEN-LINE:|7-commandAction|55|133-preAction
                // write pre-action user code here
                item = getCurrent(listPlans);
                HostDB host = new HostDB(this);
                host.queryEvents(item.getStr("user_id"), null, null, null);
                setPlansTitle(item.getStr("user"), null);
                switchDisplayable(null, getWaitPlanSearch());//GEN-LINE:|7-commandAction|56|133-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|57|112-preAction
        } else if (displayable == listRegions) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|57|112-preAction
                // write pre-action user code here
                listRegionsAction();//GEN-LINE:|7-commandAction|58|112-postAction
                // write post-action user code here
            } else if (command == cmdBack) {//GEN-LINE:|7-commandAction|59|115-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormPlanParams());//GEN-LINE:|7-commandAction|60|115-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|61|32-preAction
        } else if (displayable == listRootMenu) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|61|32-preAction
                // write pre-action user code here
                listRootMenuAction();//GEN-LINE:|7-commandAction|62|32-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|63|155-preAction
        } else if (displayable == listUsers) {
            if (command == List.SELECT_COMMAND) {//GEN-END:|7-commandAction|63|155-preAction
                // write pre-action user code here
                listUsersAction();//GEN-LINE:|7-commandAction|64|155-postAction
                // write post-action user code here
            } else if (command == cmdFM) {//GEN-LINE:|7-commandAction|65|217-preAction
                // write pre-action user code here
                item = getCurrent(listUsers);
                if(item != null)
                {
                    HostDB host = new HostDB(this);
                    host.queryUsers("FM", item.getStr("id"));
                }
                else
                {
                    return;
                }
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|66|217-postAction
                // write post-action user code here
            } else if (command == cmdFS) {//GEN-LINE:|7-commandAction|67|219-preAction
                // write pre-action user code here
                item = getCurrent(listUsers);
                if(item != null)
                {
                    HostDB host = new HostDB(this);
                    host.queryUsers("FS", item.getStr("id"));
                }
                else
                {
                    return;
                }
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|68|219-postAction
                // write post-action user code here
            } else if (command == cmdMenuLinks) {//GEN-LINE:|7-commandAction|69|237-preAction
                // write pre-action user code here
                switchDisplayable(null, getListLinks());//GEN-LINE:|7-commandAction|70|237-postAction
                // write post-action user code here
            } else if (command == cmdUserPlans) {//GEN-LINE:|7-commandAction|71|234-preAction
                // write pre-action user code here
                item = getCurrent(listUsers);
                HostDB host = new HostDB(this);
                host.queryEvents(item.getStr("id"), null, null, null);
                setPlansTitle(item.getStr("user"), null);
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|72|234-postAction
                // write post-action user code here
            } else if (command == cmdWM) {//GEN-LINE:|7-commandAction|73|213-preAction
                // write pre-action user code here
                item = getCurrent(listUsers);
                if(item != null)
                {
                    HostDB host = new HostDB(this);
                    host.queryUsers("WM", item.getStr("id"));
                }
                else
                {
                    return;
                }
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|74|213-postAction
                // write post-action user code here
            } else if (command == cmdWS) {//GEN-LINE:|7-commandAction|75|215-preAction
                // write pre-action user code here
                item = getCurrent(listUsers);
                if(item != null)
                {
                    HostDB host = new HostDB(this);
                    host.queryUsers("WS", item.getStr("id"));
                }
                else
                {
                    return;
                }
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|7-commandAction|76|215-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|77|119-preAction
        } else if (displayable == waitCities) {
            if (command == cmdCancel) {//GEN-END:|7-commandAction|77|119-preAction
                // write pre-action user code here
                switchDisplayable(null, getListRegions());//GEN-LINE:|7-commandAction|78|119-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|79|62-preAction
        } else if (displayable == waitCountries) {
            if (command == cmdCancel) {//GEN-END:|7-commandAction|79|62-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormPlanParams());//GEN-LINE:|7-commandAction|80|62-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|81|27-preAction
        } else if (displayable == waitLogin) {
            if (command == cmdCancel) {//GEN-END:|7-commandAction|81|27-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormLogin());//GEN-LINE:|7-commandAction|82|27-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|83|80-preAction
        } else if (displayable == waitPlanSearch) {
            if (command == cmdCancel) {//GEN-END:|7-commandAction|83|80-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormPlanParams());//GEN-LINE:|7-commandAction|84|80-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|85|193-preAction
        } else if (displayable == waitPlanSelect) {
            if (command == cmdCancel) {//GEN-END:|7-commandAction|85|193-preAction
                // write pre-action user code here
                switchDisplayable(null, getListPlanCategs());//GEN-LINE:|7-commandAction|86|193-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|87|108-preAction
        } else if (displayable == waitRegions) {
            if (command == cmdCancel) {//GEN-END:|7-commandAction|87|108-preAction
                // write pre-action user code here
                switchDisplayable(null, getListCountries());//GEN-LINE:|7-commandAction|88|108-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|89|152-preAction
        } else if (displayable == waitUserSearch) {
            if (command == cmdCancel) {//GEN-END:|7-commandAction|89|152-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormUserParams());//GEN-LINE:|7-commandAction|90|152-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|91|221-preAction
        } else if (displayable == waitUsers) {
            if (command == cmdCancel) {//GEN-END:|7-commandAction|91|221-preAction
                // write pre-action user code here
                switchToPreviousDisplayable();//GEN-LINE:|7-commandAction|92|221-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|93|7-postCommandAction
        }//GEN-END:|7-commandAction|93|7-postCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|94|221-postAction
    //</editor-fold>//GEN-END:|7-commandAction|94|221-postAction










    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: formLogin ">//GEN-BEGIN:|18-getter|0|18-preInit
    /**
     * Returns an initiliazed instance of formLogin component.
     * @return the initialized component instance
     */
    public Form getFormLogin() {
        if (formLogin == null) {//GEN-END:|18-getter|0|18-preInit
            // write pre-init user code here
            formLogin = new Form("\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F", new Item[] { getTxtEmail(), getTxtPassword() });//GEN-BEGIN:|18-getter|1|18-postInit
            formLogin.addCommand(getCmdLogin());
            formLogin.setCommandListener(this);//GEN-END:|18-getter|1|18-postInit
            // write post-init user code here
        }//GEN-BEGIN:|18-getter|2|
        return formLogin;
    }
    //</editor-fold>//GEN-END:|18-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtEmail ">//GEN-BEGIN:|22-getter|0|22-preInit
    /**
     * Returns an initiliazed instance of txtEmail component.
     * @return the initialized component instance
     */
    public TextField getTxtEmail() {
        if (txtEmail == null) {//GEN-END:|22-getter|0|22-preInit
            // write pre-init user code here
            txtEmail = new TextField("\u042D\u043B.\u043F\u043E\u0447\u0442\u0430", "albert.mavrin@gmail.com", 32, TextField.ANY);//GEN-LINE:|22-getter|1|22-postInit
            // write post-init user code here
        }//GEN-BEGIN:|22-getter|2|
        return txtEmail;
    }
    //</editor-fold>//GEN-END:|22-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: txtPassword ">//GEN-BEGIN:|23-getter|0|23-preInit
    /**
     * Returns an initiliazed instance of txtPassword component.
     * @return the initialized component instance
     */
    public TextField getTxtPassword() {
        if (txtPassword == null) {//GEN-END:|23-getter|0|23-preInit
            // write pre-init user code here
            txtPassword = new TextField("\u041F\u0430\u0440\u043E\u043B\u044C", "test", 32, TextField.ANY | TextField.PASSWORD);//GEN-LINE:|23-getter|1|23-postInit
            // write post-init user code here
        }//GEN-BEGIN:|23-getter|2|
        return txtPassword;
    }
    //</editor-fold>//GEN-END:|23-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdLogin ">//GEN-BEGIN:|20-getter|0|20-preInit
    /**
     * Returns an initiliazed instance of cmdLogin component.
     * @return the initialized component instance
     */
    public Command getCmdLogin() {
        if (cmdLogin == null) {//GEN-END:|20-getter|0|20-preInit
            // write pre-init user code here
            cmdLogin = new Command("\u0412\u043E\u0439\u0442\u0438", Command.OK, 0);//GEN-LINE:|20-getter|1|20-postInit
            // write post-init user code here
        }//GEN-BEGIN:|20-getter|2|
        return cmdLogin;
    }
    //</editor-fold>//GEN-END:|20-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitLogin ">//GEN-BEGIN:|24-getter|0|24-preInit
    /**
     * Returns an initiliazed instance of waitLogin component.
     * @return the initialized component instance
     */
    public CanvasWait getWaitLogin() {
        if (waitLogin == null) {//GEN-END:|24-getter|0|24-preInit
            // write pre-init user code here
            waitLogin = new CanvasWait();//GEN-BEGIN:|24-getter|1|24-postInit
            waitLogin.setTitle("\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430");
            waitLogin.addCommand(getCmdCancel());
            waitLogin.setCommandListener(this);//GEN-END:|24-getter|1|24-postInit
            // write post-init user code here
        }//GEN-BEGIN:|24-getter|2|
        return waitLogin;
    }
    //</editor-fold>//GEN-END:|24-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdCancel ">//GEN-BEGIN:|26-getter|0|26-preInit
    /**
     * Returns an initiliazed instance of cmdCancel component.
     * @return the initialized component instance
     */
    public Command getCmdCancel() {
        if (cmdCancel == null) {//GEN-END:|26-getter|0|26-preInit
            // write pre-init user code here
            cmdCancel = new Command("\u041E\u0442\u043C\u0435\u043D\u0430", Command.CANCEL, 0);//GEN-LINE:|26-getter|1|26-postInit
            // write post-init user code here
        }//GEN-BEGIN:|26-getter|2|
        return cmdCancel;
    }
    //</editor-fold>//GEN-END:|26-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: formPlanParams ">//GEN-BEGIN:|29-getter|0|29-preInit
    /**
     * Returns an initiliazed instance of formPlanParams component.
     * @return the initialized component instance
     */
    public Form getFormPlanParams() {
        if (formPlanParams == null) {//GEN-END:|29-getter|0|29-preInit
            // write pre-init user code here
            formPlanParams = new Form("\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0437\u0430\u043F\u0440\u043E\u0441\u0430", new Item[] { getStrPlanSearch(), getDateOf(), getCityOf() });//GEN-BEGIN:|29-getter|1|29-postInit
            formPlanParams.addCommand(getCmdBack());
            formPlanParams.addCommand(getCmdFindInCity());
            formPlanParams.addCommand(getCmdFindAnywhere());
            formPlanParams.addCommand(getCmdSelectCity());
            formPlanParams.setCommandListener(this);//GEN-END:|29-getter|1|29-postInit
            // write post-init user code here
        }//GEN-BEGIN:|29-getter|2|
        return formPlanParams;
    }
    //</editor-fold>//GEN-END:|29-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listRootMenu ">//GEN-BEGIN:|30-getter|0|30-preInit
    /**
     * Returns an initiliazed instance of listRootMenu component.
     * @return the initialized component instance
     */
    public List getListRootMenu() {
        if (listRootMenu == null) {//GEN-END:|30-getter|0|30-preInit
            // write pre-init user code here
            listRootMenu = new List("\u0413\u043B\u0430\u0432\u043D\u043E\u0435 \u043C\u0435\u043D\u044E", Choice.IMPLICIT);//GEN-BEGIN:|30-getter|1|30-postInit
            listRootMenu.append("\u041F\u043B\u0430\u043D\u044B", null);
            listRootMenu.append("\u041B\u044E\u0434\u0438", null);
            listRootMenu.append("\u0412\u043E\u0439\u0442\u0438 \u043A\u0430\u043A...", null);
            listRootMenu.setCommandListener(this);
            listRootMenu.setSelectedFlags(new boolean[] { false, false, false });//GEN-END:|30-getter|1|30-postInit
            // write post-init user code here
        }//GEN-BEGIN:|30-getter|2|
        return listRootMenu;
    }
    //</editor-fold>//GEN-END:|30-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listRootMenuAction ">//GEN-BEGIN:|30-action|0|30-preAction
    /**
     * Performs an action assigned to the selected list element in the listRootMenu component.
     */
    public void listRootMenuAction() {//GEN-END:|30-action|0|30-preAction
        // enter pre-action user code here
        String __selectedString = getListRootMenu().getString(getListRootMenu().getSelectedIndex());//GEN-BEGIN:|30-action|1|35-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("\u041F\u043B\u0430\u043D\u044B")) {//GEN-END:|30-action|1|35-preAction
                // write pre-action user code here
                switchDisplayable(null, getListPlanCategs());//GEN-LINE:|30-action|2|35-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u041B\u044E\u0434\u0438")) {//GEN-LINE:|30-action|3|36-preAction
                // write pre-action user code here
                switchDisplayable(null, getListLinks());//GEN-LINE:|30-action|4|36-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u0412\u043E\u0439\u0442\u0438 \u043A\u0430\u043A...")) {//GEN-LINE:|30-action|5|199-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormLogin());//GEN-LINE:|30-action|6|199-postAction
                // write post-action user code here
            }//GEN-BEGIN:|30-action|7|30-postAction
        }//GEN-END:|30-action|7|30-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|30-action|8|
    //</editor-fold>//GEN-END:|30-action|8|


    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: dateOf ">//GEN-BEGIN:|53-getter|0|53-preInit
    /**
     * Returns an initiliazed instance of dateOf component.
     * @return the initialized component instance
     */
    public DateField getDateOf() {
        if (dateOf == null) {//GEN-END:|53-getter|0|53-preInit
            // write pre-init user code here
            dateOf = new DateField("\u041D\u0430\u0447\u0438\u043D\u0430\u044F \u0441 \u0434\u0430\u0442\u044B", DateField.DATE);//GEN-BEGIN:|53-getter|1|53-postInit
            dateOf.setDate(new java.util.Date(System.currentTimeMillis()));//GEN-END:|53-getter|1|53-postInit
            // write post-init user code here
        }//GEN-BEGIN:|53-getter|2|
        return dateOf;
    }
    //</editor-fold>//GEN-END:|53-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdOk ">//GEN-BEGIN:|47-getter|0|47-preInit
    /**
     * Returns an initiliazed instance of cmdOk component.
     * @return the initialized component instance
     */
    public Command getCmdOk() {
        if (cmdOk == null) {//GEN-END:|47-getter|0|47-preInit
            // write pre-init user code here
            cmdOk = new Command("\u041E\u041A", Command.OK, 0);//GEN-LINE:|47-getter|1|47-postInit
            // write post-init user code here
        }//GEN-BEGIN:|47-getter|2|
        return cmdOk;
    }
    //</editor-fold>//GEN-END:|47-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdBack ">//GEN-BEGIN:|49-getter|0|49-preInit
    /**
     * Returns an initiliazed instance of cmdBack component.
     * @return the initialized component instance
     */
    public Command getCmdBack() {
        if (cmdBack == null) {//GEN-END:|49-getter|0|49-preInit
            // write pre-init user code here
            cmdBack = new Command("\u041D\u0430\u0437\u0430\u0434", Command.BACK, 0);//GEN-LINE:|49-getter|1|49-postInit
            // write post-init user code here
        }//GEN-BEGIN:|49-getter|2|
        return cmdBack;
    }
    //</editor-fold>//GEN-END:|49-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdSelectCity ">//GEN-BEGIN:|59-getter|0|59-preInit
    /**
     * Returns an initiliazed instance of cmdSelectCity component.
     * @return the initialized component instance
     */
    public Command getCmdSelectCity() {
        if (cmdSelectCity == null) {//GEN-END:|59-getter|0|59-preInit
            // write pre-init user code here
            cmdSelectCity = new Command("\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0433\u043E\u0440\u043E\u0434", Command.OK, 1);//GEN-LINE:|59-getter|1|59-postInit
            // write post-init user code here
        }//GEN-BEGIN:|59-getter|2|
        return cmdSelectCity;
    }
    //</editor-fold>//GEN-END:|59-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitCountries ">//GEN-BEGIN:|61-getter|0|61-preInit
    /**
     * Returns an initiliazed instance of waitCountries component.
     * @return the initialized component instance
     */
    public CanvasWait getWaitCountries() {
        if (waitCountries == null) {//GEN-END:|61-getter|0|61-preInit
            // write pre-init user code here
            waitCountries = new CanvasWait();//GEN-BEGIN:|61-getter|1|61-postInit
            waitCountries.setTitle("\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430");
            waitCountries.addCommand(getCmdCancel());
            waitCountries.setCommandListener(this);//GEN-END:|61-getter|1|61-postInit
            // write post-init user code here
        }//GEN-BEGIN:|61-getter|2|
        return waitCountries;
    }
    //</editor-fold>//GEN-END:|61-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdWatch ">//GEN-BEGIN:|65-getter|0|65-preInit
    /**
     * Returns an initiliazed instance of cmdWatch component.
     * @return the initialized component instance
     */
    public Command getCmdWatch() {
        if (cmdWatch == null) {//GEN-END:|65-getter|0|65-preInit
            // write pre-init user code here
            cmdWatch = new Command("\u0421\u043B\u0435\u0436\u0443", Command.OK, 0);//GEN-LINE:|65-getter|1|65-postInit
            // write post-init user code here
        }//GEN-BEGIN:|65-getter|2|
        return cmdWatch;
    }
    //</editor-fold>//GEN-END:|65-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdPlan ">//GEN-BEGIN:|67-getter|0|67-preInit
    /**
     * Returns an initiliazed instance of cmdPlan component.
     * @return the initialized component instance
     */
    public Command getCmdPlan() {
        if (cmdPlan == null) {//GEN-END:|67-getter|0|67-preInit
            // write pre-init user code here
            cmdPlan = new Command("\u041F\u043B\u0430\u043D\u0438\u0440\u0443\u044E", "<null>", Command.OK, 0);//GEN-LINE:|67-getter|1|67-postInit
            // write post-init user code here
        }//GEN-BEGIN:|67-getter|2|
        return cmdPlan;
    }
    //</editor-fold>//GEN-END:|67-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdShare ">//GEN-BEGIN:|69-getter|0|69-preInit
    /**
     * Returns an initiliazed instance of cmdShare component.
     * @return the initialized component instance
     */
    public Command getCmdShare() {
        if (cmdShare == null) {//GEN-END:|69-getter|0|69-preInit
            // write pre-init user code here
            cmdShare = new Command("\u0423\u0447\u0430\u0441\u0442\u0432\u0443\u044E", Command.OK, 0);//GEN-LINE:|69-getter|1|69-postInit
            // write post-init user code here
        }//GEN-BEGIN:|69-getter|2|
        return cmdShare;
    }
    //</editor-fold>//GEN-END:|69-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdAnyCity ">//GEN-BEGIN:|71-getter|0|71-preInit
    /**
     * Returns an initiliazed instance of cmdAnyCity component.
     * @return the initialized component instance
     */
    public Command getCmdAnyCity() {
        if (cmdAnyCity == null) {//GEN-END:|71-getter|0|71-preInit
            // write pre-init user code here
            cmdAnyCity = new Command("\u0412 \u043B\u044E\u0431\u043E\u043C \u0433\u043E\u0440\u043E\u0434\u0435", Command.OK, 0);//GEN-LINE:|71-getter|1|71-postInit
            // write post-init user code here
        }//GEN-BEGIN:|71-getter|2|
        return cmdAnyCity;
    }
    //</editor-fold>//GEN-END:|71-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdInCity ">//GEN-BEGIN:|73-getter|0|73-preInit
    /**
     * Returns an initiliazed instance of cmdInCity component.
     * @return the initialized component instance
     */
    public Command getCmdInCity() {
        if (cmdInCity == null) {//GEN-END:|73-getter|0|73-preInit
            // write pre-init user code here
            cmdInCity = new Command("\u041F\u043E \u0433\u043E\u0440\u043E\u0434\u0443", Command.OK, 0);//GEN-LINE:|73-getter|1|73-postInit
            // write post-init user code here
        }//GEN-BEGIN:|73-getter|2|
        return cmdInCity;
    }
    //</editor-fold>//GEN-END:|73-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: alert ">//GEN-BEGIN:|78-getter|0|78-preInit
    /**
     * Returns an initiliazed instance of alert component.
     * @return the initialized component instance
     */
    public Alert getAlert() {
        if (alert == null) {//GEN-END:|78-getter|0|78-preInit
            // write pre-init user code here
            alert = new Alert("alert");//GEN-BEGIN:|78-getter|1|78-postInit
            alert.setTimeout(Alert.FOREVER);//GEN-END:|78-getter|1|78-postInit
            // write post-init user code here
        }//GEN-BEGIN:|78-getter|2|
        return alert;
    }
    //</editor-fold>//GEN-END:|78-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitPlanSearch ">//GEN-BEGIN:|79-getter|0|79-preInit
    /**
     * Returns an initiliazed instance of waitPlanSearch component.
     * @return the initialized component instance
     */
    public CanvasWait getWaitPlanSearch() {
        if (waitPlanSearch == null) {//GEN-END:|79-getter|0|79-preInit
            // write pre-init user code here
            waitPlanSearch = new CanvasWait();//GEN-BEGIN:|79-getter|1|79-postInit
            waitPlanSearch.setTitle("\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430");
            waitPlanSearch.addCommand(getCmdCancel());
            waitPlanSearch.setCommandListener(this);//GEN-END:|79-getter|1|79-postInit
            // write post-init user code here
        }//GEN-BEGIN:|79-getter|2|
        return waitPlanSearch;
    }
    //</editor-fold>//GEN-END:|79-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listPlans ">//GEN-BEGIN:|86-getter|0|86-preInit
    /**
     * Returns an initiliazed instance of listPlans component.
     * @return the initialized component instance
     */
    public List getListPlans() {
        if (listPlans == null) {//GEN-END:|86-getter|0|86-preInit
            // write pre-init user code here
            listPlans = new List("\u041F\u043B\u0430\u043D\u044B", Choice.IMPLICIT);//GEN-BEGIN:|86-getter|1|86-postInit
            listPlans.addCommand(getCmdBack());
            listPlans.addCommand(getCmdInCity());
            listPlans.addCommand(getCmdUserPlans());
            listPlans.setCommandListener(this);
            listPlans.setSelectedFlags(new boolean[] {  });//GEN-END:|86-getter|1|86-postInit
            // write post-init user code here
        }//GEN-BEGIN:|86-getter|2|
        return listPlans;
    }
    //</editor-fold>//GEN-END:|86-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listPlansAction ">//GEN-BEGIN:|86-action|0|86-preAction
    /**
     * Performs an action assigned to the selected list element in the listPlans component.
     */
    public void listPlansAction() {//GEN-END:|86-action|0|86-preAction
        // enter pre-action user code here
        String __selectedString = getListPlans().getString(getListPlans().getSelectedIndex());//GEN-LINE:|86-action|1|86-postAction
        // enter post-action user code here
        showPlan();
    }//GEN-BEGIN:|86-action|2|
    //</editor-fold>//GEN-END:|86-action|2|


    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: formPlan ">//GEN-BEGIN:|89-getter|0|89-preInit
    /**
     * Returns an initiliazed instance of formPlan component.
     * @return the initialized component instance
     */
    public Form getFormPlan() {
        if (formPlan == null) {//GEN-END:|89-getter|0|89-preInit
            // write pre-init user code here
            formPlan = new Form("form", new Item[] { getImgPlanTime(), getStrPlanText() });//GEN-BEGIN:|89-getter|1|89-postInit
            formPlan.addCommand(getCmdBack());
            formPlan.addCommand(getCmdInCity());
            formPlan.addCommand(getCmdUserPlans());
            formPlan.setCommandListener(this);//GEN-END:|89-getter|1|89-postInit
            // write post-init user code here
        }//GEN-BEGIN:|89-getter|2|
        return formPlan;
    }
    //</editor-fold>//GEN-END:|89-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imgPlanTime ">//GEN-BEGIN:|96-getter|0|96-preInit
    /**
     * Returns an initiliazed instance of imgPlanTime component.
     * @return the initialized component instance
     */
    public ImageItem getImgPlanTime() {
        if (imgPlanTime == null) {//GEN-END:|96-getter|0|96-preInit
            // write pre-init user code here
            imgPlanTime = new ImageItem("imageItem", null, ImageItem.LAYOUT_DEFAULT, "<Missing Image>");//GEN-LINE:|96-getter|1|96-postInit
            // write post-init user code here
        }//GEN-BEGIN:|96-getter|2|
        return imgPlanTime;
    }
    //</editor-fold>//GEN-END:|96-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: strPlanText ">//GEN-BEGIN:|97-getter|0|97-preInit
    /**
     * Returns an initiliazed instance of strPlanText component.
     * @return the initialized component instance
     */
    public StringItem getStrPlanText() {
        if (strPlanText == null) {//GEN-END:|97-getter|0|97-preInit
            // write pre-init user code here
            strPlanText = new StringItem("stringItem", null);//GEN-LINE:|97-getter|1|97-postInit
            // write post-init user code here
        }//GEN-BEGIN:|97-getter|2|
        return strPlanText;
    }
    //</editor-fold>//GEN-END:|97-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listCountries ">//GEN-BEGIN:|99-getter|0|99-preInit
    /**
     * Returns an initiliazed instance of listCountries component.
     * @return the initialized component instance
     */
    public List getListCountries() {
        if (listCountries == null) {//GEN-END:|99-getter|0|99-preInit
            // write pre-init user code here
            listCountries = new List("\u0421\u0442\u0440\u0430\u043D\u044B", Choice.IMPLICIT);//GEN-BEGIN:|99-getter|1|99-postInit
            listCountries.addCommand(getCmdBack());
            listCountries.setCommandListener(this);//GEN-END:|99-getter|1|99-postInit
            // write post-init user code here
        }//GEN-BEGIN:|99-getter|2|
        return listCountries;
    }
    //</editor-fold>//GEN-END:|99-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listCountriesAction ">//GEN-BEGIN:|99-action|0|99-preAction
    /**
     * Performs an action assigned to the selected list element in the listCountries component.
     */
    public void listCountriesAction() {//GEN-END:|99-action|0|99-preAction
        // enter pre-action user code here
        String __selectedString = getListCountries().getString(getListCountries().getSelectedIndex());//GEN-LINE:|99-action|1|99-postAction
        // enter post-action user code here
        int i = getListCountries().getSelectedIndex();
        item = (UniItem) items.elementAt(i);
        HostDB host = new HostDB(this);
        host.queryRegions(item.getStr("id"));
        switchDisplayable(null, getWaitRegions());
    }//GEN-BEGIN:|99-action|2|
    //</editor-fold>//GEN-END:|99-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitRegions ">//GEN-BEGIN:|107-getter|0|107-preInit
    /**
     * Returns an initiliazed instance of waitRegions component.
     * @return the initialized component instance
     */
    public CanvasWait getWaitRegions() {
        if (waitRegions == null) {//GEN-END:|107-getter|0|107-preInit
            // write pre-init user code here
            waitRegions = new CanvasWait();//GEN-BEGIN:|107-getter|1|107-postInit
            waitRegions.setTitle("\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430");
            waitRegions.addCommand(getCmdCancel());
            waitRegions.setCommandListener(this);//GEN-END:|107-getter|1|107-postInit
            // write post-init user code here
        }//GEN-BEGIN:|107-getter|2|
        return waitRegions;
    }
    //</editor-fold>//GEN-END:|107-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand ">//GEN-BEGIN:|104-getter|0|104-preInit
    /**
     * Returns an initiliazed instance of itemCommand component.
     * @return the initialized component instance
     */
    public Command getItemCommand() {
        if (itemCommand == null) {//GEN-END:|104-getter|0|104-preInit
            // write pre-init user code here
            itemCommand = new Command("Item", Command.ITEM, 0);//GEN-LINE:|104-getter|1|104-postInit
            // write post-init user code here
        }//GEN-BEGIN:|104-getter|2|
        return itemCommand;
    }
    //</editor-fold>//GEN-END:|104-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listRegions ">//GEN-BEGIN:|111-getter|0|111-preInit
    /**
     * Returns an initiliazed instance of listRegions component.
     * @return the initialized component instance
     */
    public List getListRegions() {
        if (listRegions == null) {//GEN-END:|111-getter|0|111-preInit
            // write pre-init user code here
            listRegions = new List("\u0420\u0435\u0433\u0438\u043E\u043D\u044B", Choice.IMPLICIT);//GEN-BEGIN:|111-getter|1|111-postInit
            listRegions.addCommand(getCmdBack());
            listRegions.setCommandListener(this);//GEN-END:|111-getter|1|111-postInit
            // write post-init user code here
        }//GEN-BEGIN:|111-getter|2|
        return listRegions;
    }
    //</editor-fold>//GEN-END:|111-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listRegionsAction ">//GEN-BEGIN:|111-action|0|111-preAction
    /**
     * Performs an action assigned to the selected list element in the listRegions component.
     */
    public void listRegionsAction() {//GEN-END:|111-action|0|111-preAction
        // enter pre-action user code here
        String __selectedString = getListRegions().getString(getListRegions().getSelectedIndex());//GEN-LINE:|111-action|1|111-postAction
        // enter post-action user code here
        int i = getListRegions().getSelectedIndex();
        item = (UniItem) items.elementAt(i);
        HostDB host = new HostDB(this);
        host.queryCities(item.getStr("id"));
        switchDisplayable(null, getWaitCities());
    }//GEN-BEGIN:|111-action|2|
    //</editor-fold>//GEN-END:|111-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitCities ">//GEN-BEGIN:|114-getter|0|114-preInit
    /**
     * Returns an initiliazed instance of waitCities component.
     * @return the initialized component instance
     */
    public CanvasWait getWaitCities() {
        if (waitCities == null) {//GEN-END:|114-getter|0|114-preInit
            // write pre-init user code here
            waitCities = new CanvasWait();//GEN-BEGIN:|114-getter|1|114-postInit
            waitCities.setTitle("\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430");
            waitCities.addCommand(getCmdCancel());
            waitCities.setCommandListener(this);//GEN-END:|114-getter|1|114-postInit
            // write post-init user code here
        }//GEN-BEGIN:|114-getter|2|
        return waitCities;
    }
    //</editor-fold>//GEN-END:|114-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listCities ">//GEN-BEGIN:|121-getter|0|121-preInit
    /**
     * Returns an initiliazed instance of listCities component.
     * @return the initialized component instance
     */
    public List getListCities() {
        if (listCities == null) {//GEN-END:|121-getter|0|121-preInit
            // write pre-init user code here
            listCities = new List("\u0413\u043E\u0440\u043E\u0434\u0430", Choice.IMPLICIT);//GEN-BEGIN:|121-getter|1|121-postInit
            listCities.addCommand(getCmdBack());
            listCities.setCommandListener(this);//GEN-END:|121-getter|1|121-postInit
            // write post-init user code here
        }//GEN-BEGIN:|121-getter|2|
        return listCities;
    }
    //</editor-fold>//GEN-END:|121-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listCitiesAction ">//GEN-BEGIN:|121-action|0|121-preAction
    /**
     * Performs an action assigned to the selected list element in the listCities component.
     */
    public void listCitiesAction() {//GEN-END:|121-action|0|121-preAction
        // enter pre-action user code here
        String __selectedString = getListCities().getString(getListCities().getSelectedIndex());//GEN-LINE:|121-action|1|121-postAction
        // enter post-action user code here
        int i = getListCities().getSelectedIndex();
        item = (UniItem) items.elementAt(i);
        HostDB host = new HostDB(this);
        String city_id = item.getStr("id");
        cli.setCityID(city_id);
        cli.setCity(__selectedString);
        cityOf.setText(__selectedString);
        host.queryEvents(null, city_id, dateOf.getDate(), null);
        setPlansTitle("г.", __selectedString);
        switchDisplayable(null, getWaitPlanSearch());
    }//GEN-BEGIN:|121-action|2|
    //</editor-fold>//GEN-END:|121-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cityOf ">//GEN-BEGIN:|130-getter|0|130-preInit
    /**
     * Returns an initiliazed instance of cityOf component.
     * @return the initialized component instance
     */
    public StringItem getCityOf() {
        if (cityOf == null) {//GEN-END:|130-getter|0|130-preInit
            // write pre-init user code here
            cityOf = new StringItem("\u041F\u043E \u0433\u043E\u0440\u043E\u0434\u0443", cli.getCity());//GEN-LINE:|130-getter|1|130-postInit
            // write post-init user code here
        }//GEN-BEGIN:|130-getter|2|
        return cityOf;
    }
    //</editor-fold>//GEN-END:|130-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdUserPlans ">//GEN-BEGIN:|132-getter|0|132-preInit
    /**
     * Returns an initiliazed instance of cmdUserPlans component.
     * @return the initialized component instance
     */
    public Command getCmdUserPlans() {
        if (cmdUserPlans == null) {//GEN-END:|132-getter|0|132-preInit
            // write pre-init user code here
            cmdUserPlans = new Command("\u041F\u043B\u0430\u043D\u044B \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F", Command.OK, 0);//GEN-LINE:|132-getter|1|132-postInit
            // write post-init user code here
        }//GEN-BEGIN:|132-getter|2|
        return cmdUserPlans;
    }
    //</editor-fold>//GEN-END:|132-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdMore ">//GEN-BEGIN:|134-getter|0|134-preInit
    /**
     * Returns an initiliazed instance of cmdMore component.
     * @return the initialized component instance
     */
    public Command getCmdMore() {
        if (cmdMore == null) {//GEN-END:|134-getter|0|134-preInit
            // write pre-init user code here
            cmdMore = new Command("\u0415\u0449\u0435", Command.OK, 0);//GEN-LINE:|134-getter|1|134-postInit
            // write post-init user code here
        }//GEN-BEGIN:|134-getter|2|
        return cmdMore;
    }
    //</editor-fold>//GEN-END:|134-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: formUserParams ">//GEN-BEGIN:|144-getter|0|144-preInit
    /**
     * Returns an initiliazed instance of formUserParams component.
     * @return the initialized component instance
     */
    public Form getFormUserParams() {
        if (formUserParams == null) {//GEN-END:|144-getter|0|144-preInit
            // write pre-init user code here
            formUserParams = new Form("\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438", new Item[] { getStrUserSearch() });//GEN-BEGIN:|144-getter|1|144-postInit
            formUserParams.addCommand(getCmdOk());
            formUserParams.addCommand(getCmdBack());
            formUserParams.setCommandListener(this);//GEN-END:|144-getter|1|144-postInit
            // write post-init user code here
        }//GEN-BEGIN:|144-getter|2|
        return formUserParams;
    }
    //</editor-fold>//GEN-END:|144-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: strUserSearch ">//GEN-BEGIN:|146-getter|0|146-preInit
    /**
     * Returns an initiliazed instance of strUserSearch component.
     * @return the initialized component instance
     */
    public TextField getStrUserSearch() {
        if (strUserSearch == null) {//GEN-END:|146-getter|0|146-preInit
            // write pre-init user code here
            strUserSearch = new TextField("\u0418\u0441\u043A\u0430\u0442\u044C", null, 32, TextField.ANY);//GEN-BEGIN:|146-getter|1|146-postInit
            strUserSearch.setInitialInputMode("UCB_CYRILLIC");//GEN-END:|146-getter|1|146-postInit
            // write post-init user code here
        }//GEN-BEGIN:|146-getter|2|
        return strUserSearch;
    }
    //</editor-fold>//GEN-END:|146-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitUserSearch ">//GEN-BEGIN:|150-getter|0|150-preInit
    /**
     * Returns an initiliazed instance of waitUserSearch component.
     * @return the initialized component instance
     */
    public CanvasWait getWaitUserSearch() {
        if (waitUserSearch == null) {//GEN-END:|150-getter|0|150-preInit
            // write pre-init user code here
            waitUserSearch = new CanvasWait();//GEN-BEGIN:|150-getter|1|150-postInit
            waitUserSearch.setTitle("\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430");
            waitUserSearch.addCommand(getCmdCancel());
            waitUserSearch.setCommandListener(this);//GEN-END:|150-getter|1|150-postInit
            // write post-init user code here
        }//GEN-BEGIN:|150-getter|2|
        return waitUserSearch;
    }
    //</editor-fold>//GEN-END:|150-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listUsers ">//GEN-BEGIN:|154-getter|0|154-preInit
    /**
     * Returns an initiliazed instance of listUsers component.
     * @return the initialized component instance
     */
    public List getListUsers() {
        if (listUsers == null) {//GEN-END:|154-getter|0|154-preInit
            // write pre-init user code here
            listUsers = new List("\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438", Choice.IMPLICIT);//GEN-BEGIN:|154-getter|1|154-postInit
            listUsers.addCommand(getCmdWM());
            listUsers.addCommand(getCmdWS());
            listUsers.addCommand(getCmdFM());
            listUsers.addCommand(getCmdFS());
            listUsers.addCommand(getCmdUserPlans());
            listUsers.addCommand(getCmdMenuLinks());
            listUsers.setCommandListener(this);//GEN-END:|154-getter|1|154-postInit
            // write post-init user code here
        }//GEN-BEGIN:|154-getter|2|
        return listUsers;
    }
    //</editor-fold>//GEN-END:|154-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listUsersAction ">//GEN-BEGIN:|154-action|0|154-preAction
    /**
     * Performs an action assigned to the selected list element in the listUsers component.
     */
    public void listUsersAction() {//GEN-END:|154-action|0|154-preAction
        // enter pre-action user code here
        String __selectedString = getListUsers().getString(getListUsers().getSelectedIndex());//GEN-LINE:|154-action|1|154-postAction
        // enter post-action user code here
        item = getCurrent(listUsers);
        Form f = getFormUser();
        StringItem si = getStrUserShort();
        si.setLabel(item.getStr("name"));
        String txt = "\nГОРОД: "+ item.getStr("city") + "\n" +
                "ДАТА РОЖДЕНИЯ: "+ item.getStr("born") + "\n" +
                "О СЕБЕ: "+ item.getStr("note");
        si.setText(txt);
        switchDisplayable(null, f);
    }//GEN-BEGIN:|154-action|2|
    //</editor-fold>//GEN-END:|154-action|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listLinks ">//GEN-BEGIN:|159-getter|0|159-preInit
    /**
     * Returns an initiliazed instance of listLinks component.
     * @return the initialized component instance
     */
    public List getListLinks() {
        if (listLinks == null) {//GEN-END:|159-getter|0|159-preInit
            // write pre-init user code here
            listLinks = new List("\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C", Choice.IMPLICIT);//GEN-BEGIN:|159-getter|1|159-postInit
            listLinks.append("\u0417\u0430 \u043A\u0435\u043C \u044F \u0441\u043B\u0435\u0436\u0443", null);
            listLinks.append("\u041A\u0442\u043E \u0441\u043B\u0435\u0434\u0438\u0442 \u0437\u0430 \u043C\u043D\u043E\u0439", null);
            listLinks.append("\u041A\u043E\u043C\u0443 \u044F \u0434\u043E\u0432\u0435\u0440\u044F\u044E", null);
            listLinks.append("\u041A\u0442\u043E \u043C\u043D\u0435 \u0434\u043E\u0432\u0435\u0440\u044F\u0435\u0442", null);
            listLinks.append("\u0418\u0441\u043A\u0430\u0442\u044C", null);
            listLinks.addCommand(getCmdBack());
            listLinks.setCommandListener(this);
            listLinks.setSelectedFlags(new boolean[] { false, false, false, false, false });//GEN-END:|159-getter|1|159-postInit
            // write post-init user code here
        }//GEN-BEGIN:|159-getter|2|
        return listLinks;
    }
    //</editor-fold>//GEN-END:|159-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listLinksAction ">//GEN-BEGIN:|159-action|0|159-preAction
    /**
     * Performs an action assigned to the selected list element in the listLinks component.
     */
    public void listLinksAction() {//GEN-END:|159-action|0|159-preAction
        // enter pre-action user code here
        String link_type = "";
        String __selectedString = getListLinks().getString(getListLinks().getSelectedIndex());//GEN-BEGIN:|159-action|1|162-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("\u0417\u0430 \u043A\u0435\u043C \u044F \u0441\u043B\u0435\u0436\u0443")) {//GEN-END:|159-action|1|162-preAction
                // write pre-action user code here
                link_type = "WM";
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|159-action|2|162-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u041A\u0442\u043E \u0441\u043B\u0435\u0434\u0438\u0442 \u0437\u0430 \u043C\u043D\u043E\u0439")) {//GEN-LINE:|159-action|3|163-preAction
                // write pre-action user code here
                link_type = "WS";
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|159-action|4|163-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u041A\u043E\u043C\u0443 \u044F \u0434\u043E\u0432\u0435\u0440\u044F\u044E")) {//GEN-LINE:|159-action|5|164-preAction
                // write pre-action user code here
                link_type = "FM";
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|159-action|6|164-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u041A\u0442\u043E \u043C\u043D\u0435 \u0434\u043E\u0432\u0435\u0440\u044F\u0435\u0442")) {//GEN-LINE:|159-action|7|165-preAction
                // write pre-action user code here
                link_type = "FS";
                switchDisplayable(null, getWaitUsers());//GEN-LINE:|159-action|8|165-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u0418\u0441\u043A\u0430\u0442\u044C")) {//GEN-LINE:|159-action|9|166-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormUserParams());//GEN-LINE:|159-action|10|166-postAction
                // write post-action user code here
                return;
            }//GEN-BEGIN:|159-action|11|159-postAction
        }//GEN-END:|159-action|11|159-postAction
        // enter post-action user code here
        HostDB host = new HostDB(this);
        host.queryUsers(link_type, null);
    }//GEN-BEGIN:|159-action|12|
    //</editor-fold>//GEN-END:|159-action|12|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdLogin1 ">//GEN-BEGIN:|171-getter|0|171-preInit
    /**
     * Returns an initiliazed instance of cmdLogin1 component.
     * @return the initialized component instance
     */
    public Command getCmdLogin1() {
        if (cmdLogin1 == null) {//GEN-END:|171-getter|0|171-preInit
            // write pre-init user code here
            cmdLogin1 = new Command("Ok", Command.OK, 0);//GEN-LINE:|171-getter|1|171-postInit
            // write post-init user code here
        }//GEN-BEGIN:|171-getter|2|
        return cmdLogin1;
    }
    //</editor-fold>//GEN-END:|171-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdGoLogin ">//GEN-BEGIN:|173-getter|0|173-preInit
    /**
     * Returns an initiliazed instance of cmdGoLogin component.
     * @return the initialized component instance
     */
    public Command getCmdGoLogin() {
        if (cmdGoLogin == null) {//GEN-END:|173-getter|0|173-preInit
            // write pre-init user code here
            cmdGoLogin = new Command("\u0412\u043E\u0439\u0442\u0438 \u043A\u0430\u043A...", Command.OK, 0);//GEN-LINE:|173-getter|1|173-postInit
            // write post-init user code here
        }//GEN-BEGIN:|173-getter|2|
        return cmdGoLogin;
    }
    //</editor-fold>//GEN-END:|173-getter|2|



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: listPlanCategs ">//GEN-BEGIN:|183-getter|0|183-preInit
    /**
     * Returns an initiliazed instance of listPlanCategs component.
     * @return the initialized component instance
     */
    public List getListPlanCategs() {
        if (listPlanCategs == null) {//GEN-END:|183-getter|0|183-preInit
            // write pre-init user code here
            listPlanCategs = new List("\u041F\u043B\u0430\u043D\u044B", Choice.IMPLICIT);//GEN-BEGIN:|183-getter|1|183-postInit
            listPlanCategs.append("\u0422\u0435\u0445, \u0437\u0430 \u043A\u0435\u043C \u0441\u043B\u0435\u0436\u0443", null);
            listPlanCategs.append("\u041C\u043E\u0438", null);
            listPlanCategs.append("\u0412 \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044E", null);
            listPlanCategs.append("\u0418\u0441\u043A\u0430\u0442\u044C", null);
            listPlanCategs.addCommand(getCmdBack());
            listPlanCategs.setCommandListener(this);
            listPlanCategs.setSelectedFlags(new boolean[] { false, false, false, false });//GEN-END:|183-getter|1|183-postInit
            // write post-init user code here
        }//GEN-BEGIN:|183-getter|2|
        return listPlanCategs;
    }
    //</editor-fold>//GEN-END:|183-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: listPlanCategsAction ">//GEN-BEGIN:|183-action|0|183-preAction
    /**
     * Performs an action assigned to the selected list element in the listPlanCategs component.
     */
    public void listPlanCategsAction() {//GEN-END:|183-action|0|183-preAction
        // enter pre-action user code here
        String __selectedString = getListPlanCategs().getString(getListPlanCategs().getSelectedIndex());//GEN-BEGIN:|183-action|1|186-preAction
        if (__selectedString != null) {
            if (__selectedString.equals("\u0422\u0435\u0445, \u0437\u0430 \u043A\u0435\u043C \u0441\u043B\u0435\u0436\u0443")) {//GEN-END:|183-action|1|186-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryEvents(null, null, null, "sub");
                setPlansTitle("Я слежу", null);
                switchDisplayable(null, getWaitPlanSelect());//GEN-LINE:|183-action|2|186-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u041C\u043E\u0438")) {//GEN-LINE:|183-action|3|187-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryEvents(null, null, null, "own");
                setPlansTitle("Я планирую", null);
                switchDisplayable(null, getWaitPlanSelect());//GEN-LINE:|183-action|4|187-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u0412 \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044E")) {//GEN-LINE:|183-action|5|188-preAction
                // write pre-action user code here
                HostDB host = new HostDB(this);
                host.queryEvents(null, null, null, "sha");
                setPlansTitle("Я участвую", null);
                switchDisplayable(null, getWaitPlanSelect());//GEN-LINE:|183-action|6|188-postAction
                // write post-action user code here
            } else if (__selectedString.equals("\u0418\u0441\u043A\u0430\u0442\u044C")) {//GEN-LINE:|183-action|7|189-preAction
                // write pre-action user code here
                switchDisplayable(null, getFormPlanParams());//GEN-LINE:|183-action|8|189-postAction
                // write post-action user code here
            }//GEN-BEGIN:|183-action|9|183-postAction
        }//GEN-END:|183-action|9|183-postAction
        // enter post-action user code here
    }//GEN-BEGIN:|183-action|10|
    //</editor-fold>//GEN-END:|183-action|10|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitPlanSelect ">//GEN-BEGIN:|192-getter|0|192-preInit
    /**
     * Returns an initiliazed instance of waitPlanSelect component.
     * @return the initialized component instance
     */
    public CanvasWait getWaitPlanSelect() {
        if (waitPlanSelect == null) {//GEN-END:|192-getter|0|192-preInit
            // write pre-init user code here
            waitPlanSelect = new CanvasWait();//GEN-BEGIN:|192-getter|1|192-postInit
            waitPlanSelect.setTitle("\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430");
            waitPlanSelect.addCommand(getCmdCancel());
            waitPlanSelect.setCommandListener(this);//GEN-END:|192-getter|1|192-postInit
            // write post-init user code here
        }//GEN-BEGIN:|192-getter|2|
        return waitPlanSelect;
    }
    //</editor-fold>//GEN-END:|192-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: strPlanSearch ">//GEN-BEGIN:|201-getter|0|201-preInit
    /**
     * Returns an initiliazed instance of strPlanSearch component.
     * @return the initialized component instance
     */
    public TextField getStrPlanSearch() {
        if (strPlanSearch == null) {//GEN-END:|201-getter|0|201-preInit
            // write pre-init user code here
            strPlanSearch = new TextField("\u0418\u0441\u043A\u0430\u0442\u044C", null, 32, TextField.ANY);//GEN-BEGIN:|201-getter|1|201-postInit
            strPlanSearch.setInitialInputMode("UCB_CYRILLIC");//GEN-END:|201-getter|1|201-postInit
            // write post-init user code here
        }//GEN-BEGIN:|201-getter|2|
        return strPlanSearch;
    }
    //</editor-fold>//GEN-END:|201-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdResetCity ">//GEN-BEGIN:|204-getter|0|204-preInit
    /**
     * Returns an initiliazed instance of cmdResetCity component.
     * @return the initialized component instance
     */
    public Command getCmdResetCity() {
        if (cmdResetCity == null) {//GEN-END:|204-getter|0|204-preInit
            // write pre-init user code here
            cmdResetCity = new Command("Ok", Command.OK, 0);//GEN-LINE:|204-getter|1|204-postInit
            // write post-init user code here
        }//GEN-BEGIN:|204-getter|2|
        return cmdResetCity;
    }
    //</editor-fold>//GEN-END:|204-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdFindInCity ">//GEN-BEGIN:|206-getter|0|206-preInit
    /**
     * Returns an initiliazed instance of cmdFindInCity component.
     * @return the initialized component instance
     */
    public Command getCmdFindInCity() {
        if (cmdFindInCity == null) {//GEN-END:|206-getter|0|206-preInit
            // write pre-init user code here
            cmdFindInCity = new Command("\u0418\u0441\u043A\u0430\u0442\u044C \u0432 \u0433\u043E\u0440\u043E\u0434\u0435", Command.OK, 0);//GEN-LINE:|206-getter|1|206-postInit
            // write post-init user code here
        }//GEN-BEGIN:|206-getter|2|
        return cmdFindInCity;
    }
    //</editor-fold>//GEN-END:|206-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdFindAnywhere ">//GEN-BEGIN:|208-getter|0|208-preInit
    /**
     * Returns an initiliazed instance of cmdFindAnywhere component.
     * @return the initialized component instance
     */
    public Command getCmdFindAnywhere() {
        if (cmdFindAnywhere == null) {//GEN-END:|208-getter|0|208-preInit
            // write pre-init user code here
            cmdFindAnywhere = new Command("\u0418\u0441\u043A\u0430\u0442\u044C \u0432\u0435\u0437\u0434\u0435", Command.OK, 0);//GEN-LINE:|208-getter|1|208-postInit
            // write post-init user code here
        }//GEN-BEGIN:|208-getter|2|
        return cmdFindAnywhere;
    }
    //</editor-fold>//GEN-END:|208-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdWM ">//GEN-BEGIN:|212-getter|0|212-preInit
    /**
     * Returns an initiliazed instance of cmdWM component.
     * @return the initialized component instance
     */
    public Command getCmdWM() {
        if (cmdWM == null) {//GEN-END:|212-getter|0|212-preInit
            // write pre-init user code here
            cmdWM = new Command("\u0417\u0430 \u043A\u0435\u043C \u0441\u043B\u0435\u0434\u0438\u0442", Command.OK, 0);//GEN-LINE:|212-getter|1|212-postInit
            // write post-init user code here
        }//GEN-BEGIN:|212-getter|2|
        return cmdWM;
    }
    //</editor-fold>//GEN-END:|212-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdWS ">//GEN-BEGIN:|214-getter|0|214-preInit
    /**
     * Returns an initiliazed instance of cmdWS component.
     * @return the initialized component instance
     */
    public Command getCmdWS() {
        if (cmdWS == null) {//GEN-END:|214-getter|0|214-preInit
            // write pre-init user code here
            cmdWS = new Command("\u041A\u0442\u043E \u0441\u043B\u0435\u0434\u0438\u0442", Command.OK, 0);//GEN-LINE:|214-getter|1|214-postInit
            // write post-init user code here
        }//GEN-BEGIN:|214-getter|2|
        return cmdWS;
    }
    //</editor-fold>//GEN-END:|214-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdFM ">//GEN-BEGIN:|216-getter|0|216-preInit
    /**
     * Returns an initiliazed instance of cmdFM component.
     * @return the initialized component instance
     */
    public Command getCmdFM() {
        if (cmdFM == null) {//GEN-END:|216-getter|0|216-preInit
            // write pre-init user code here
            cmdFM = new Command("\u041A\u043E\u043C\u0443 \u0434\u043E\u0432\u0435\u0440\u044F\u0435\u0442", Command.OK, 0);//GEN-LINE:|216-getter|1|216-postInit
            // write post-init user code here
        }//GEN-BEGIN:|216-getter|2|
        return cmdFM;
    }
    //</editor-fold>//GEN-END:|216-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdFS ">//GEN-BEGIN:|218-getter|0|218-preInit
    /**
     * Returns an initiliazed instance of cmdFS component.
     * @return the initialized component instance
     */
    public Command getCmdFS() {
        if (cmdFS == null) {//GEN-END:|218-getter|0|218-preInit
            // write pre-init user code here
            cmdFS = new Command("\u041A\u0442\u043E \u0434\u043E\u0432\u0435\u0440\u044F\u0435\u0442", Command.OK, 0);//GEN-LINE:|218-getter|1|218-postInit
            // write post-init user code here
        }//GEN-BEGIN:|218-getter|2|
        return cmdFS;
    }
    //</editor-fold>//GEN-END:|218-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitUsers ">//GEN-BEGIN:|220-getter|0|220-preInit
    /**
     * Returns an initiliazed instance of waitUsers component.
     * @return the initialized component instance
     */
    public CanvasWait getWaitUsers() {
        if (waitUsers == null) {//GEN-END:|220-getter|0|220-preInit
            // write pre-init user code here
            waitUsers = new CanvasWait();//GEN-BEGIN:|220-getter|1|220-postInit
            waitUsers.setTitle("\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430");
            waitUsers.addCommand(getCmdCancel());
            waitUsers.setCommandListener(this);//GEN-END:|220-getter|1|220-postInit
            // write post-init user code here
        }//GEN-BEGIN:|220-getter|2|
        return waitUsers;
    }
    //</editor-fold>//GEN-END:|220-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: formUser ">//GEN-BEGIN:|227-getter|0|227-preInit
    /**
     * Returns an initiliazed instance of formUser component.
     * @return the initialized component instance
     */
    public Form getFormUser() {
        if (formUser == null) {//GEN-END:|227-getter|0|227-preInit
            // write pre-init user code here
            formUser = new Form("\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435", new Item[] { getStrUserShort() });//GEN-BEGIN:|227-getter|1|227-postInit
            formUser.addCommand(getCmdBack());
            formUser.addCommand(getCmdWM());
            formUser.addCommand(getCmdWS());
            formUser.addCommand(getCmdFM());
            formUser.addCommand(getCmdFS());
            formUser.addCommand(getCmdUserPlans());
            formUser.setCommandListener(this);//GEN-END:|227-getter|1|227-postInit
            // write post-init user code here
        }//GEN-BEGIN:|227-getter|2|
        return formUser;
    }
    //</editor-fold>//GEN-END:|227-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: strUserShort ">//GEN-BEGIN:|228-getter|0|228-preInit
    /**
     * Returns an initiliazed instance of strUserShort component.
     * @return the initialized component instance
     */
    public StringItem getStrUserShort() {
        if (strUserShort == null) {//GEN-END:|228-getter|0|228-preInit
            // write pre-init user code here
            strUserShort = new StringItem("stringItem", null);//GEN-LINE:|228-getter|1|228-postInit
            // write post-init user code here
        }//GEN-BEGIN:|228-getter|2|
        return strUserShort;
    }
    //</editor-fold>//GEN-END:|228-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdMenuLinks ">//GEN-BEGIN:|236-getter|0|236-preInit
    /**
     * Returns an initiliazed instance of cmdMenuLinks component.
     * @return the initialized component instance
     */
    public Command getCmdMenuLinks() {
        if (cmdMenuLinks == null) {//GEN-END:|236-getter|0|236-preInit
            // write pre-init user code here
            cmdMenuLinks = new Command("\u041C\u043E\u0438 \u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u044F", Command.BACK, 0);//GEN-LINE:|236-getter|1|236-postInit
            // write post-init user code here
        }//GEN-BEGIN:|236-getter|2|
        return cmdMenuLinks;
    }
    //</editor-fold>//GEN-END:|236-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: cmdDoWatch ">//GEN-BEGIN:|252-getter|0|252-preInit
    /**
     * Returns an initiliazed instance of cmdDoWatch component.
     * @return the initialized component instance
     */
    public Command getCmdDoWatch() {
        if (cmdDoWatch == null) {//GEN-END:|252-getter|0|252-preInit
            // write pre-init user code here
            cmdDoWatch = new Command("\u0421\u043B\u0435\u0434\u0438\u0442\u044C", Command.ITEM, 0);//GEN-LINE:|252-getter|1|252-postInit
            // write post-init user code here
        }//GEN-BEGIN:|252-getter|2|
        return cmdDoWatch;
    }
    //</editor-fold>//GEN-END:|252-getter|2|



    public void onLoginOK() {
        switchDisplayable(null, getListRootMenu());
    }

    public void onLoginError(String ErrMsg) {
        switchDisplayable(null, getFormLogin());
    }

    public void showPlans() {
        List l = getListPlans();
        l.setTitle(plan_list_title);
        l.deleteAll();
        int n = items.size();
        for (int i = 0; i < n; i++) {
            l.append(makePlanLine(i), makeTimeImage(i));
        }

        switchDisplayable(null, l);
    }

    public void showPlan(){
        int i = getListPlans().getSelectedIndex();
        item = (UniItem) items.elementAt(i);
        Form f = getFormPlan();
        String username = item.getStr("user");
        f.setTitle(username);
        imgPlanTime.setLabel(item.getStr("date"));
        strPlanText.setLabel("[" + item.getStr("city") + "] ");
        String s = item.getStr("text");
        s += "\n"+ "участвует: " + item.getStr("num_sha");
        s += "\n"+ "мнений: " + item.getStr("num_com");
        strPlanText.setText(s);
        try {
            imgPlanTime.setImage(Image.createImage("/img/" + item.getStr("parts") + ".png"));
        } catch (IOException ignored) {}
        switchDisplayable(null, f);
    }

    private void setPlansTitle(String s1, String s2)
    {
        plan_list_title = "";
        if(s1 != null) plan_list_title += " " + s1;
        if(s2 != null) plan_list_title += " " + s2;
        plan_list_title = plan_list_title.trim();
        if(plan_list_title.length() == 0) plan_list_title = "Планы";
    }

    private String makePlanLine(int Index) {
        UniItem ui = (UniItem) items.elementAt(Index);
        return ui.getStr("date") + " " + ui.getStr("user") + ": " + ui.getStr("text");
    }

    private Image makeTimeImage(int Index) {
        UniItem ui = (UniItem) items.elementAt(Index);
        String img_name = "/img/" + ui.getStr("parts") + ".png";
        Image img = null;
        try {
            img = Image.createImage(img_name);
        } catch (IOException e) {
            System.out.println(e.getClass() + ": " + e.getMessage());
        }
        return img;
    }

    public void showUsers()
    {
        List l = getListUsers();
        l.deleteAll();
        int n = items.size();
        for (int i = 0; i < n; i++) {
            l.append(makeUserLine(i), null);
        }
        switchDisplayable(null, l);
    }

    private String makeUserLine(int Index)
    {
        UniItem ui = (UniItem) items.elementAt(Index);
        return ui.getStr("name") + " [" + ui.getStr("city") + "]";
    }

    public void showCountries() {
        List l = getListCountries();
        l.deleteAll();
        int n = items.size();
        for (int i = 0; i < n; i++) {
            UniItem ui = (UniItem) items.elementAt(i);
            l.append(ui.getStr("name"), null);
        }
        switchDisplayable(null, l);
    }

    public void showRegions() {
        List l = getListRegions();
        l.deleteAll();
        int n = items.size();
        for (int i = 0; i < n; i++) {
            UniItem ui = (UniItem) items.elementAt(i);
            l.append(ui.getStr("name"), null);
        }
        switchDisplayable(null, l);
    }

    public void showCities() {
        List l = getListCities();
        l.deleteAll();
        int n = items.size();
        for (int i = 0; i < n; i++) {
            UniItem ui = (UniItem) items.elementAt(i);
            l.append(ui.getStr("name"), null);
        }
        switchDisplayable(null, l);
    }

    private UniItem getCurrent(List L)
    {
        int i = L.getSelectedIndex();
        if(i == -1)
            return null;
        else
            return (UniItem)items.elementAt(i);
    }

    private void showMessage(String msg) {
        getAlert().setString(msg);
    }

    private void test()
    {
        System.out.println("test() -> password: "+ cli.getPassword());
    }

    /**
     * Returns a display instance.
     * @return the display instance.
     */
    public Display getDisplay() {
        return Display.getDisplay(this);
    }

    /**
     * Exits MIDlet.
     */
    public void exitMIDlet() {
        switchDisplayable(null, null);
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Called when MIDlet is started.
     * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
     */
    public void startApp() {
        if (midletPaused) {
            resumeMIDlet();
        } else {
            initialize();
            startMIDlet();
        }
        midletPaused = false;
    }

    /**
     * Called when MIDlet is paused.
     */
    public void pauseApp() {
        midletPaused = true;
    }

    /**
     * Called to signal the MIDlet to terminate.
     * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
     */
    public void destroyApp(boolean unconditional) {
    }
}
